import request from '@/utils/request'

// 获取列表
export function getRoleList(params) {
  return request({
    url: '/manage/rbac/index',
    method: 'get',
    params
  })
}

export function roleAdd(data) {
  return request({
    url: '/manage/rbac/roleAdd',
    method: 'post',
    data
  })
}

export function roleEdit(data) {
  return request({
    url: '/manage/rbac/roleEdit',
    method: 'post',
    data
  })
}

export function getMenuList() {
  return request({
    url: '/manage/rbac/menu',
    method: 'get',
  })
}

export function getRoleInfo(params) {
  return request({
    url: '/manage/rbac/info',
    method: 'get',
    params
  })
}

export function roleDelete(data) {
 return request({
    url: '/manage/rbac/roleDelete',
    method: 'post',
    data
  })
}


// --------------------- 管理员列表 -----------------
export function getUserIndex(params) {
  return request({
    url: '/manage/admin/userIndex',
    method: 'get',
    params
  })
}

export function userAdd(data) {
  return request({
    url: '/manage/admin/userAdd',
    method: 'post',
    data
  })
}

export function userEdit(data) {
    return request({
      url: '/manage/admin/userEdit',
      method: 'post',
      data
    })
  }

  export function getUserInfo(params) {
    return request({
      url: '/manage/admin/userInfo',
      method: 'get',
      params
    })
  }
  
  export function userDel(data) {
    return request({
      url: '/manage/admin/userDel',
      method: 'post',
      data
    })
  }
  
  export function roleStatusClose(data) {
    return request({
      url: '/manage/rbac/roleStatusClose',
      method: 'post',
      data
    })
  }

  export function roleStatusOpen(data) {
    return request({
      url: '/manage/rbac/roleStatusOpen',
      method: 'post',
      data
    })
  }
  
  